//
//  ViewController.m
//  OC网络请求封装
//
//  Created by HM on 16/9/20.
//  Copyright © 2016年 HM. All rights reserved.
//

#import "ViewController.h"
#import "HMNetworkTools.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self loadData];
}


- (void)loadData {
    NSString *url = @"http://192.168.0.141:8080/loginStuUser";
    NSDictionary *dict = @{
                           @"login_name":@"baihaitao",
                           @"login_pwd":@"123456",
                          
                           };
    [[HMNetworkTools sharedTools] requestWithType:POST andUrl:url andParams:dict andCallBack:^(id response, NSError *error) {
        if (error) {
            NSLog(@"网络请求异常: %@", error);
            return;
        }
        //  代码执行到此表示数据请求成功
        NSLog(@"请求成功");
        NSLog(@"%@", response);
        
        
        
        
    }];
    

}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
